const backToTopBtn = document.querySelector('.back-top');

window.addEventListener('scroll', function () {
  if (window.pageYOffset >= 0) {
    backToTopBtn.style.display = 'block';
  }
});
backToTopBtn.addEventListener('click', function () {
  window.scrollTo({
    top: 0,
    behavior: 'smooth'
  });
});